package com.chrray.position.mapper.position;
import com.chrray.position.mapper.position.base.SysMenuBaseMapper;
import com.chrray.position.entity.position.SysMenu;
import com.chrray.position.pojo.dto.auth.SysMenuTreeDto;
import com.chrray.position.pojo.dto.auth.SysOperationDto;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.List;

/**
 *系统权限菜单表 数据访问
 @author lm
 */
public interface SysMenuMapper extends Mapper<SysMenu>, MySqlMapper<SysMenu>,SysMenuBaseMapper{
    /**
     * 查询全部菜单权限
     * @param level
     * @param parentId
     * @return
     */
    List<SysMenuTreeDto> listAll(@Param("level") Integer level, @Param("parentId")  Long parentId);

    /**
     *根据权限查询按钮权限
     * @param menuId
     * @return
     */
    List<SysOperationDto> listByMenuId(@Param("menuId") Long menuId);


    List<SysMenuTreeDto>  listAllByRoleId(@Param("roleId") Long roleId);
    List<SysMenuTreeDto>  listAllBySysUserId(@Param("sysUserId") Long sysUserId);

    List<SysMenuTreeDto> treeAllMenu();
}
